﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdbService
{
    /// <summary>
    /// 服务定位器，提供全局访问点
    /// </summary>
    public static class ServiceLocator
    {
        private static IAdbCommandService _adbCommandService;

        /// <summary>
        /// 获取ADB命令服务实例
        /// </summary>
        public static IAdbCommandService AdbCommandService
        {
            get
            {
                if (_adbCommandService == null)
                {
                    _adbCommandService = new AdbCommandService();
                }
                return _adbCommandService;
            }
            set
            {
                _adbCommandService = value;
            }
        }

        /// <summary>
        /// 注册自定义服务实例
        /// </summary>
        public static void RegisterAdbCommandService(IAdbCommandService service)
        {
            _adbCommandService = service;
        }
    }
}
